
import java.sql.SQLException;

import Entity.Book;

import controllers.DBController;
import controllers.SubscriberUIP;
import messagesPacks.SubscriberSearchBookMassege;
import messagesPacks.SubscriberUpdateProfileMessage;
import messagesPacks.ViewHistoryMessage;
import fit.ActionFixture;
import gui.SubscriberUI;


public class SearchBook  extends ActionFixture 

{
	 DBController dbc=null;
	 SubscriberSearchBookMassege sb=null;
	 Book book;
	 
	 public SearchBook()
	 {
		 try 
		 {
			 dbc = new DBController("localhost", 3306, "root","Braude","obl");
		 } 
		 catch (InstantiationException e) 
		 {
			 e.printStackTrace();
		 } 
		 catch (IllegalAccessException e) 
		 {
			 e.printStackTrace();
		 }
		 catch (ClassNotFoundException e) 
		 {
			 e.printStackTrace();
		 } 
		 catch (SQLException e) 
		 {
			 e.printStackTrace();
		 }
	
		 sb = new SubscriberSearchBookMassege();
	 }
	 
//	public void enterBookName(String bookName)
//	{
//		book.setBookName(bookName);
//		sb.setBook(book);
//	}
//	 
//	public void enterAuthorName(String userID)
//	{
//		vh.setUserID(userID);
//	}
//	
//	public void enterSubject(String userID)
//	{
//		vh.setUserID(userID);
//	}

	public void enterFreeText(String freeText)
	{
		sb.setFreeText(freeText);
	}
	
	public void search_book()
	{
		dbc.searchBook(null, sb);
		
	}
 
	public int Search()
	{
		return sb.getQueryResult();
		

	}

	

}


